package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.project.bean.GradeBean;
import com.project.bean.RoleBean;
import com.project.bean.UserBean;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IUserMapper extends BaseMapper<UserBean> {
    void add(@Param("userId") int userId, @Param("roleIdArr") int[] roleIdArr);

    @Delete("delete from t_user_role where fk_userId=#{id}")
    void del(int id);

    List<RoleBean> findByUserId(int Id);
    List<GradeBean> findById(int userId);

    void updateRole(@Param("userId") int userId,@Param("roleArr") int[] roleArray);

}
